import axios from '../axios'

/*
 * 消息管理模块
 */

// 新增
export const save = (data) => {
  return axios({
    url: '/systemMessage/saveMessage',
    method: 'post',
    data
  })
}
// 删除
export const batchDelete = (params) => {
  return axios({
    url: '/systemMessage/deleteMessage',
    method: 'post',
    params
  })
}

//编辑
export const edit = (data) => {
  return axios({
    url: '/systemMessage/updateMessage',
    method: 'post',
    data
  })
}
//禁用启用
export const messageStatus = (params) => {
  return axios({
    url: '/systemMessage/updateMessageStatus',
    method: 'post',
    params
  })
}
//禁用启用
export const updateRead = (params) => {
  return axios({
    url: 'systemMessage/updateMsgReadStatus',
    method: 'post',
    params
  })
}
// 分页查询
export const findPage = (params) => {
  return axios({
    url: '/systemMessage/queryMessageList',
    method: 'get',
    params
  })
}
// 按条件id查询
export const search = (params) => {
  return axios({
    url: '/systemMessage/queryUserList',
    method: 'get',
    params
  })
}
export const queryMessageById = (params) => {
  return axios({
    url: '/systemMessage/queryMessageById',
    method: 'get',
    params
  })
}

//定时接收消息
export const getMessage= (params) => {
  return axios({
    url: '/systemMessage/getMessageNumber',
    method: 'get',
    params
  })
}
// 订阅消息
export const subscribe = (params) => {
  return axios({
    url: '/systemMessage/subscribe',
    method: 'post',
    params
  })
}
// 查询订阅消息
export const isSubscribe = (params) => {
  return axios({
    url: '/systemMessage/isSubscribe',
    method: 'get',
    params
  })
}

// 查询系统用户
export const unionUserList = (params) => {
  return axios({
    url: '/systemMessage/unionUserList',
    method: 'get',
    params
  })
}

